
#ifndef LEDBLINK_H
#define LEDBLINK_H

#include "Arduino.h"

class LedBlink
{
  
public:
  LedBlink(int ledPin);
  void startBlink(long interv, long totalBlinkTime);
  void stopBlink();
  void setLedStateAndWriteValue(int state);
  int update(); //update the led state if necessary; returns true if the the led hasn't finished blinking (interval * blinkTimes milliseconds
  
private:
  int _ledPin;
  int _enabled;
  int _ledState;
  long _interval;
  long _totalBlinkTime;
  long _startTime;
  long _lastLedStateChangeTime;
};


#endif
